// todo 创建路由  配置路由规则  导出路由实例对象

// 导入页面
import Layout from '@/views/Layout'
import Home from '@/views/Home'
import Search from '@/views/Search'
import Play from '@/views/Play'
import Layout from '@/views/Layout'
import Home from '@/views/Home'
import Search from '@/views/Search'
import Play from '@/views/Play'
import Vue from 'vue'
//导入路由
import VueRouter from 'vue-router'

//注册
Vue.use(VueRouter)

//配置路由规则
const routes = [
  //设置2个一级路由,设置重定向，设置二级路由
  {
    path:'/',
    redirect: '/layout'
  },
  {
    path:'/layout',
    component: Layout,
    children:[
      {
        path:'home',
        component:Home
      },
      {
        path:'search',
        component:Search
      }
    ]
  },
  {
    path:'/play',
    component:Play
  }
]